package com.example.user.newsongpaly;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by User on 2017/8/3.
 */

public class ListContentlist {
    private static ListContentlist listContentlist=null;
    private List<SongJsong.ShowapiResBodyBean.PagebeanBean.ContentlistBean> list = new ArrayList<>();
    private int item = 0;
    private int i=0;
    private ListContentlist(){}
    public static ListContentlist getlistContentlist(){
        if (listContentlist==null){
            listContentlist = new ListContentlist();
        }
        return listContentlist;
    }

    public int getitem(){
        if (item+1>list.size()){
            item=list.size();
            return -1;
        }else if (item<0){
            item=0;
            return -2;
        }
        return item;
    }
    public void setJiaitem(){
        if (i==0){
            i=1;
            return;
        }
        this.item = item+1;
    }

    public void setJianitem(){
        this.item = item-1;
    }
    public void setitem(int item){
        this.item = item;
    }
    public void setContentlistBean(SongJsong.ShowapiResBodyBean.PagebeanBean.ContentlistBean contentlistBean){
        list.add(contentlistBean);
    }
    public SongJsong.ShowapiResBodyBean.PagebeanBean.ContentlistBean  getContentlistBean(){
        return list.get(item);
    }
    public int getContentlistBeanSize(){
        return list.size();
    }
    public List<SongJsong.ShowapiResBodyBean.PagebeanBean.ContentlistBean>  getContentlistBeans(){
        return list;
    }
}
